<?php 
namespace app\sgb\logic;   
use think\Model;

/**
 * Log逻辑定义
 * Class LogLogic
 * @package admin\logic
 */
class UsersLogic extends Model
{
	public $errorMsg=[];   

    /**
     *
     * 获取用户token信息
     */
    public function getUserToken($data){
        $where = array();
        if(isset($data['user_id']) && $data['user_id']){
            $where['user_id'] = $data['user_id'];
        }

        if(isset($data['mobile_type']) && $data['mobile_type']){
            $where['mobile_type'] = $data['mobile_type'];
        }

        if(isset($data['inteface_type']) && $data['inteface_type']){
            $where['inteface_type'] = $data['inteface_type'];
        }

        if(isset($data['devicecode']) && $data['devicecode']){
            $where['devicecode'] = $data['devicecode'];
        }

        if(isset($data['token']) && $data['token']){
            $where['token'] = $data['token'];
        }
        return db('users')->where($where)->find('users_token');
    }  
}